import { dateFilter } from '@/filters/index'

// 计划列表
export const planColumn = [
  {
    prop: 'sort',
    label: '序号'
  },
  {
    prop: 'name',
    label: '计划名称'
  },
  {
    prop: 'beginDate',
    label: '开始日期'
  },
  {
    prop: 'endDate',
    label: '结束日期'
  },
  {
    prop: 'orderCount',
    label: '收费单数'
  },
  {
    prop: 'paiedOrderCount',
    label: '已缴费数'
  },
  {
    prop: 'title',
    label: '说明'
  },
  {
    prop: 'action',
    label: '操作',
    rest: {
      fixed: 'right'
    }
  }
]

// 账单列表
export const accountColumn = [
  {
    prop: 'title',
    label: '账单名称',
    width: 260
  },
  {
    prop: 'orderSn',
    label: '账单编号',
    width: 260
  },
  {
    prop: 'childName',
    label: '学生'
  },
  {
    prop: 'className',
    label: '班级'
  },
  {
    prop: 'totalAmount',
    label: '金额/元'
  },
  {
    prop: 'created',
    label: '日期'
  },
  {
    prop: 'payStatus',
    label: '状态'
  },
  {
    prop: 'action',
    label: '操作'
  }
]

export const payStatusList = [
  { id: '', name: '全部', type: 'warning' },
  { id: '0', name: '未支付', type: 'danger' },
  { id: '1', name: '已支付', type: 'success' }
]

export const accountInfoColumn = [
  {
    prop: 'productName',
    label: '收费项目'
  },
  {
    prop: 'productUnit',
    label: '单位'
  },
  {
    prop: 'standardUnitAmount',
    label: '标准价格/元'
  },
  {
    prop: 'practicalAmount',
    label: '实际价格/元'
  },
  {
    prop: 'count',
    label: '数量'
  },
  {
    prop: 'practicalTotalAmount',
    label: '总金额/元'
  },
  {
    prop: 'remark',
    label: '备注'
  }
]

export const infoItems = (info) => {
  return [
    {
      label: '孩子姓名',
      key: 'clienteleName',
      initialValue: info.clienteleName,
      layoutCol: { sm: 24, md: 24, lg: 24 }
    },
    {
      label: '账单名称',
      key: 'name',
      initialValue: info.name
    },
    {
      label: '账单编号',
      key: 'code',
      initialValue: info.code
    },
    {
      label: '账单金额',
      key: 'totalAmount',
      initialValue: '￥' + info.totalAmount
    },
    {
      label: '创建时间',
      key: 'signDate',
      initialValue: dateFilter(info.created)
    }
  ]
}
